package com.bxtel.model;

import javax.persistence.*;
import javax.validation.constraints.NotNull;



// @NamedQueries(value = {
//
// @NamedQuery(name = User.QUERY_FIND_BY_LOGIN,
//
// query = "select u from User u where u." + User.name
//
// + " = :username"),
//
// @NamedQuery(name = "getUsernamePasswordToken",
//
// query = "select new com.aceona.weibo.vo.TokenBO(u.username,u.password) from
// User u where u." + User.PROP_LOGIN
//
// + " = :username")})
@Entity
@Table(name = "user")
public class User {

	// Entity's fields (private)

	// An autogenerated id (unique for each user in the db)
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	// The user's email
	@NotNull
	private String email;

	// The user's name
	@NotNull
	private String name;

	// Public methods

	public User() {
	}

	public User(long id) {
		this.id = id;
	}

	public User(String email, String name) {
		this.email = email;
		this.name = name;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
